问题与代码
// Copyright (c) 2014软件技术2班
// All rights rwserved.
// 作者:B10
// 完成日期:2014年11月27日
// 版本号:v1.0
//
//编写程序:输出n=10的杨辉三角(共11行)
class Program
{
static void Main(string[] args)
{
Console.Title = "杨辉三角";
int[,] yhsj = new int[11, 11];
for (int x = 0; x < yhsj.GetLength(0); x++)
{
yhsj[x, 0] = 1;
yhsj[x, x] = 1;
if (x > 1)
{
for (int y = 1; y < yhsj.GetLength(1); y++)
{
yhsj[x, y] = yhsj[x - 1, y - 1] + yhsj[x - 1, y];
}
}
}
for (int x = 0; x < yhsj.GetLength(0); x++)